Pearson Edexcel · A-Level · Mathematics

    Course version: 603/1499/0 · Version from Sept 2017

    Decision Mathematics 1: 1.2 Bin packing, bubble sort and quick sort.

    Full specification wording

    Algorithms and graph theory - Paper 3D: Decision Mathematics 1: 1.2 Bin packing, bubble sort and quick sort.

    Three standard algorithms appear here.

    • Point 2 of 4

    Study notes

    From the teaching notes for this specification point.

    The idea

    Three standard algorithms appear here. First-fit bin packing places each item in the first bin that still has room, opening a new bin only when no existing bin can take it; first-fit decreasing sorts the items largest first, then applies first-fit. Bubble sort compares adjacent items and swaps them when they are out of order, repeating passes until a complete pass makes no swaps. Quick sort chooses a pivot, partitions the remaining items into those smaller and those larger, then applies the same method to each part. In every case show the working: the bin contents and capacities, the list after each pass, or the pivot and the two sublists. A useful check is that the number of bins, or the sorted order, is consistent with the working shown.

    What earns the marks

    • Places each item in the first bin with sufficient remaining capacity when applying first-fit.
    • Opens a new bin only when no existing bin can accommodate the current item.
    • Compares adjacent items and swaps only those that are out of order during a bubble sort pass.
    • Selects a pivot and partitions the remaining items into smaller and larger sublists for quick sort.
    • States the completed sorted list or the final bin allocation consistent with the working shown.

    Common mistakes and how to put them right

    • Skips a bin that still has room and opens a new one.

      Put it right: Check every existing bin in order before starting another.

    • Swaps adjacent items that are already in the correct order.

      Put it right: Compare each pair before acting.

    • Sorts the whole list in one quick sort step instead of partitioning about a pivot.

      Put it right: Show the pivot and the two sublists at each stage.

    Exam tips

    • Show each bubble sort pass as a separate line so swaps are visible.
    • Label the pivot at every quick sort stage and keep sublists in their original relative order.
    • For bin packing, record the remaining capacity of each bin as you go.

    Try the lesson

    The start of the Algorithms and graph theory - Paper 3D: Decision Mathematics 1: 1.2 Bin packing, bubble sort and quick sort. lesson, made from teaching notes for this specification point.

    Have a go first

    A bubble sort is applied to the list 4, 1, 3, 2, comparing adjacent pairs from left to right and swapping where the left value exceeds the right. What is the list after the first complete pass?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    5 free practice questions every day · Free forever · No card required

    Test your understanding of Algorithms and graph theory - Paper 3D: Decision Mathematics 1: 1.2 Bin packing, bubble sort and quick sort.

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    5 free practice questions every day · Free forever · No card required